package com.tyijian.springside.core;

import java.util.HashMap;
import java.util.Map;

public class ResponseBodyBuilder {
	
	/**
	 * 返回一个成功的信息
	 * 
	 * @param msg
	 * @return
	 */
	public static Map<String, Object> responseSuccessMsg(){
		Map<String,Object> responseMap =new HashMap<String,Object>();
		responseMap.put(JsonConstant.ERRMSG, "请求成功");
		return responseMap;
	}
	/**
	 * 返回一个捕捉异常的信息
	 * 
	 * @param msg
	 * @return
	 */
	public static Map<String, Object> responseErrMsg(String msg){
		Map<String,Object> responseMap =new HashMap<String,Object>();
		responseMap.put(JsonConstant.ERRMSG, msg);
		return responseMap;
	}
	
	/**
	 * 返回一个捕捉异常的信息
	 * 
	 * @param errcode
	 * @param msg
	 * @return
	 */
	public static Map<String, Object> responseErrMsg(String errcode,String msg){
		Map<String,Object> responseMap =new HashMap<String,Object>();
		responseMap.put(JsonConstant.ERRCODE, errcode);
		responseMap.put(JsonConstant.ERRMSG, msg);
		return responseMap;
	}
}
